package com.fly.springbootTemplate.serviceImpl;

import com.fly.springbootTemplate.dao.StudentCardDao;
import com.fly.springbootTemplate.entity.StudentCard;
import com.fly.springbootTemplate.service.StudentCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class StudentCardServiceImpl implements StudentCardService {
    @Autowired
    private StudentCardDao studentCardDao;
    @Override
    public boolean addStudentCard(StudentCard studentCard) {
        return studentCardDao.insertStudentCard(studentCard);
    }

    @Override
    public boolean deleteStudentCard(Integer sno) {
        return studentCardDao.deleteStudentCard(sno);
    }

    @Override
    public boolean updateStudentCard(StudentCard studentCard) {
        return studentCardDao.updateStudentCard(studentCard);
    }

    @Override
    public List<StudentCard> getAllStudentCard() {
        return studentCardDao.selectAllStudentCard();
    }

    @Override
    public StudentCard getStudentCardBySno(Integer sno) {
        return studentCardDao.selectStudentCardBySno(sno);
    }
}
